<admintpl file="header"/>
<link rel="stylesheet" href="__PUBLIC__/css/jquery.datetimepicker.css">
<link rel="stylesheet" href="__PUBLIC__/css/wechat.css">
<link rel="stylesheet" href="__PUBLIC__/css/main.css">
<script src="__PUBLIC__/js/laydate.js"></script>
<script src="__PUBLIC__/js/uploadify/jquery2.js" type="text/javascript"></script>
<script src="__PUBLIC__/js/artDialog/artDialog.js"></script>
<script src="__PUBLIC__/js/common.js"></script>
<script src="__PUBLIC__/js/wechat.js"></script>

<style>
    .well input, select {
        margin-top: 10px;
    }

    .well select {
        height: 37px;
        line-height: 37px
    }
</style>
</head>

<body>

<div class="manage">
    <span><a href="">微信推送</a></span>
</div>

<div class="act_main">

    <a href="#">推送管理</a>
    >>
    <span class="tag-list">
        新建推送
    </span>

</div>

<div class="wrap">

    <div class="push-news">

        <div class="form-horizontal Jactadd">

            <div class="control-group">
                <label class="control-label ">推送范围</label>

                <div class="controls push-tags">
                    <input type="text" name="taginfo" class="tag-info" data-city="" data-actid="{$mate.id}">
                    <ul>
                        <li><input type="radio" name="tags" value="all"><span class="tag-text">所有标签</span></li>
                        <li><input type="radio" name="tags" value="city" class="tags-city">选择</li>
                    </ul>
                    <ol>
                        <foreach name="tagInfo" item="v">
                            <li><input type="checkbox" class="citylist" data-city="{$v.cityid}"><span class="tag-name">{$v.name}</span>
                            </li>
                        </foreach>
                    </ol>
                </div>
            </div>


            <div class="control-group">
                <label class="control-label ">素材预览</label>

                <div class="controls push-view">
                    <span class="mediaId" data-mediaid="{$mate.media_id}">
                        <ul>

                            <?php if($mate['type']=='news'){ ?>
                                <foreach name="mate['itemInfo']['news_item']" item="vo">
                                    <li>
                                        <div id="hotnews">
                                            <?php if($vo['thumb_url']){ ?> <script type="text/javascript">showImg('{$vo.thumb_url}');</script><?php } ?>
                                            <?php echo $vo['title'];?>
                                        </div>
                                    </li>
                                </foreach>
                            <?php }else{ ?>

                                <li>
                                    <div id="hotlinkimg">
                                        <script type="text/javascript">showImg('{$vo.itemInfo.url}');</script>
                                    </div>
                                </li>

                            <?php } ?>
                        </ul>
                    </span>
                </div>

                <div class="setView activityList">

                    <a href="javascript:;" class="setMobile" data-id="{$mate.media_id}" data-title="{$mate.title}" data-type="{$mate.type}" data-toggle="modal" data-target="#JActivityeditact">发送至手机预览</a>

                </div>

            </div>


            <div class="control-group">
                <label class="control-label">推送时间</label>

                <div class="controls">
                    <div><input type="radio" name="setMate" value="now" checked>立即发送</div>
                    <!--<div><input type="radio" name="setMate" value="time">定时发送<input type="text" id="linetime"></div>-->
                </div>

            </div>


            <div class="control-group" style="text-align: center">
                <div class="loadSubmit">
                    <button type="submit" class="btn btn-danger Jsubmit checkSubmit">发送</button>
                </div>

            </div>

        </div>

    </div>

</div>


<div class="modal fade" id="JActivityeditact" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
     style="width: 500px; display: none;">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header" style="background-color: #ecf0f1">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                        aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myShopLabel" style="color: #000">发送预览 关注公众号后，才能接收图文消息预览</h4>
            </div>

            <input type="hidden" name="media_id">
            <input type="hidden" name="media_title">
            <input type="hidden" name="media_type">

            <div class="modal-body">
                <div class="form-horizontal">

                    <div class="control-group">
                        <div class="control-list">

                            <?php foreach($viewList as $v){ ?>
                                <span>
                                    <input type="checkbox" class="checkbox-openid" data-remark="{$v.remark}"  value="{$v.open_id}" checked> {$v.open_id}  ({$v.remark})
                                </span>
                            <?php } ?>

                        </div>

                    </div>


                    <div class="text-center">
                        <a href="javascript:;" class="add-opemid btn ">添加</a>
                    </div>

                    <div class="Openid-Info text-center"></div>

                </div>
            </div>
            <div class="modal-footer" style="text-align: center">

                <button type="button" class="btn btn-danger JsaveActivity">发送</button>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">
    var previewUrl = "{:U('Matelist/Matelist/sendPreview')}";

    var saveOpenId = "{:U('Matelist/Matelist/saveOpenId')}";
    var pushUrl = "{:U('Push/addPush')}";
    var pushList = "{:U('Push/index')}";

    $(function () {

        $('#linetime').click(function () {
            laydate({elem: '#linetime', format: 'YYYY-MM-DD hh:mm:ss', istime: true});
        });
    })

</script>


<script src="__PUBLIC__/js/tablesorter/dist/js/jquery.tablesorter.min.js"></script>
<script src="__PUBLIC__/js/tablesorter/dist/js/jquery.tablesorter.widgets.min.js"></script>
<link rel="stylesheet" href="__PUBLIC__/js/tablesorter/dist/css/theme.default.min.css">
</body>
</html>